﻿using System;

namespace Aeon.Emulator.Decoding
{
    /// <summary>
    /// Indicates that an invalid Mod-3 instruction was detected.
    /// </summary>
    [Serializable]
    internal sealed class Mod3Exception : Exception
    {
        /// <summary>
        /// Initializes a new instance of the Mod3Exception class.
        /// </summary>
        public Mod3Exception()
            : base(DefaultMessage)
        {
        }

        /// <summary>
        /// Initializes a new instance of the Mod3Exception class.
        /// </summary>
        /// <param name="message">Message describing the error.</param>
        public Mod3Exception(string message) : base(message)
        {
        }
        
        /// <summary>
        /// Initializes a new instance of the Mod3Exception class.
        /// </summary>
        /// <param name="message">Message describing the error.</param>
        /// <param name="inner">Exception which triggered this exception.</param>
        public Mod3Exception(string message, Exception inner) : base(message, inner)
        {
        }

        /// <summary>
        /// Default message for the exception.
        /// </summary>
        private const string DefaultMessage = "Mod value was 3 on a memory-only operand.";
    }
}
